// run: $exec < input
#include <iostream>
#include <string>
#include <cctype>

int const maxn = 200;
std::string name[maxn];
bool vis[maxn];
int n;

bool cannot(int i, int j)
{
	if (name[i].size() != name[j].size()) return false;
	int l = name[i].size(), count = 0;
	for (int k = 0; k < l; k++)
		count += (std::tolower(name[i][k]) == std::tolower(name[j][k]));
	return count > 2;
}

int main()
{
	while (std::cin >> n) {
		for (int i = 0; i < n; i++)
			std::cin >> name[i];
		for (int i = 0; i < n; i++) vis[i] = false;

		for (int i = 0; i < n; i++)
			for (int j = i + 1; j < n; j++)
				if (cannot(i, j)) vis[i] = vis[j] = true;
		int ans = 0;
		for (int i = 0; i < n; i++) ans += vis[i];
		std::cout << ans << '\n';
	}
}

